import request from '@/utils/request'
import { getToken } from '@/utils/token'

export function getTrainPlan (startDate,endDate) {
  return request({
    method:'GET',
    url:'train/getTrainPlan',
    params:{startDate,endDate},
    headers:{
      'Access-Token':getToken()
    }
  })
}


// 添加课程
export function addTrain(trainingSession) {
  return request({
    method:'POST',
    url:'train/addTrain',
    data:trainingSession,
    headers:{
      'Access-Token':getToken()
    }
  })
}


// 修改课程
export function modifyTrain(trainingSession) {

  return request({
    method: 'POST',
    url: 'train/modify',
    data: trainingSession,
        headers:{
      'Access-Token':getToken()
    }
  })
}


//删除课程

export function deleteTrain(trainId) {
  return request({
    method: 'GET',
    url: 'train/deleteTrain',
    params:{trainId},
    headers:{
      'Access-Token':getToken()
    }
  })
}
